home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 October: Technology Seed / ADC Seed CD - October 1999.toast / FireWire / FireWire_2.1_SDK_DR3 / Source / FWiX / FWiXDriver / FWiXDriver.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-17  |  6.0 KB  |  166 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        FWiXDriver.h
  3.  
  4.     Contains:    Definitions for FWiXDriver.
  5.  
  6.     Version:    1.0
  7.  
  8.     Written by:    Jay Lloyd
  9.  
  10.     Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  11.  
  12.     File Ownership:
  13.  
  14.         DRI:                Jay Lloyd
  15.  
  16.         Other Contact:        
  17.  
  18.         Technology:            FireWire
  19.  
  20.     Writers:
  21.  
  22.         (jkl)    Jay Lloyd
  23.  
  24.     Change History (most recent first):
  25.  
  26.       <FW16>      7/7/98    jkl        Add address space ID for local data buffer to FWXNodeDataStruct.
  27.       <FW15>     5/28/97    jkl        Added control indexing fields to node data structure.
  28.       <FW14>     5/15/97    jkl        Added two fields to the node data structure, a boolean to tell
  29.                                     if transfer is halted due to flow control, and an index for flow
  30.                                     control messages.
  31.       <FW13>     2/21/97    ES        Added in use flags for all FWCommandObjects.
  32.       <FW12>     2/21/97    jkl        Modified driver and node data structure fields for sending data
  33.                                     to non notify address space.
  34.       <FW11>     2/19/97    jkl        Added a flow control pending flag in the node data structure.
  35.       <FW10>     2/14/97    jkl        Added flow control request and reply fields to node data
  36.                                     structure.
  37.        <FW9>     2/13/97    jkl        Added another received packet counter field in node data
  38.                                     structure.
  39.        <FW8>     2/13/97    jkl        Changed flow control counters in node data structure.
  40.        <FW7>     2/11/97    ES        Added closed field to FWXNodeData record.
  41.        <FW6>     2/11/97    jkl        Added fields in node data for read control and data queues and
  42.                                     flow control mechanism.
  43.        <FW5>      1/8/97    ES        Changed to a FireWire protocol driver. Removed fixed FireWire
  44.                                     address allocation.
  45.        <FW4>    11/13/96    jkl        Moved from DoDriverIO interface to CallDriver. Added multiple
  46.                                     machine support.
  47.        <FW3>     10/31/96    jkl        Added constants for flow control
  48.        <FW2>     10/16/96    jkl        Added address space id's and a flow control
  49.                                     buffer to the driver globals.
  50.        <FW1>     10/2/96    jkl        Initial check-in, copied from avc driver.
  51.  
  52. */
  53.  
  54. #ifndef __FWIXDRIVER__
  55. #define __FWIXDRIVER__
  56.  
  57. #ifndef __TYPES__
  58. #include <Types.h>
  59. #endif
  60. #ifndef __FIREWIRE__
  61. #include <FireWire.h>
  62. #endif
  63.  
  64. #ifdef __cplusplus
  65. extern "C" {
  66. #endif
  67.  
  68. #if PRAGMA_IMPORT_SUPPORTED
  69. #pragma import on
  70. #endif
  71.  
  72. #if PRAGMA_ALIGN_SUPPORTED
  73. #pragma options align=mac68k
  74. #endif
  75.  
  76. enum {
  77.     kFlowControlSize    = 12,                    // 3 longs
  78.     kDataDoneBufSize    = 16
  79. };
  80.  
  81. typedef struct FWXDriverDataStruct
  82.                                 FWXDriverData,
  83.                                 *FWXDriverDataPtr;
  84.  
  85. typedef struct FWXNodeDataStruct
  86.                                 FWXNodeData,
  87.                                 *FWXNodeDataPtr;
  88.  
  89. typedef struct FWXUnitInfoStruct
  90.                                 FWXUnitInfo,
  91.                                 *FWXUnitInfoPtr;
  92.  
  93. struct FWXDriverDataStruct
  94. {
  95.     FWPDriverID                    fwPDriverID;            // Our FireWire protocol driver ID.
  96.     FWXDriverID                    fwxDriverID;            // Our FWX driver ID.
  97.     FWXNodeDataPtr                fwxNodeDataList;        // List of node data records.
  98.     CSRROMEntryID                unitCSRROMEntryID;        // ID of unit directory on local node.
  99.     Ptr                            controlBuffer;            // a control packet buffer
  100.     Ptr                            fcBuffer;                // a flow control packet buffer
  101.     FWAddressSpaceID            controlAddressSpaceID;    // id of address space for control packets
  102.     FWAddress                    controlAddress;            // address space for control packets
  103.     FWAddressSpaceID            fcAddressSpaceID;        // id of address space for flow control packets
  104.     FWAddress                    fcAddress;                // address space for flow control packets
  105. };
  106.  
  107. struct FWXUnitInfoStruct
  108. {
  109.     FWAddress                    controlAddress;            // Address to send control packets to.
  110.     FWAddress                    fcAddress;                // Address to send flow control packets to.
  111. };
  112.  
  113. struct FWXNodeDataStruct
  114. {
  115.     FWXNodeDataPtr                pPrevFWXNodeData,        // Previous and next node data records.
  116.                                 pNextFWXNodeData;
  117.     FWXDriverDataPtr            pFWXDriverData;            // Our driver data.
  118.     FWUnitID                    fwUnitID;                // Unit ID of node.
  119.     FWDeviceID                    fwDeviceID;                // Device ID of node.
  120.     FWCommandObjectID            writeAsynchCommandObjectID;    // Command object for asynchronous write transactions.
  121.     FWCommandObjectID            fcSendCommandObjectID;    // Command object for asynchronous flow control requests.
  122.     FWCommandObjectID            fcReplyCommandObjectID;    // Command object for asynchronous flow control replies.
  123.     FWAddress                    remoteDataAddress;        // remote node's address space for my data packets
  124.     FWAddressSpaceID            localDataAddressSpaceID;    // id of address space for remote node's data packets
  125.     FWAddress                    localDataAddress;        // my address space for remote node's data packets
  126.     Ptr                            dataBuffer;                // space for receiving data from node
  127.     FWXUnitInfo                    fwxUnitInfo;            // Unit information about node.
  128.     TimerID                        fcTimerID;                // flow control timer
  129.     QHdrPtr                        pReadControlQHdr;        // queued read parameter blocks
  130.     QHdrPtr                        pReadDataQHdr;            // queued read parameter blocks
  131.     QHdrPtr                        pWriteQHdr;                // queued write parameter blocks
  132.     IOParamPtr                    pCurIOParam;            // parameter block being processed
  133.     SInt32*                        dataDoneBuffer;            // a flow control buffer
  134.     SInt32*                        fcSendBuffer;            // a flow control buffer
  135.     SInt32*                        fcReplyBuffer;            // a flow control buffer
  136.     SInt32                        dataPbCount;            // number of read data parameter blocks
  137.     SInt32                        controlPbCount;            // number of read control parameter blocks
  138.     SInt32                        dataPbAvail;            // number of read data parameter blocks available to sender
  139.     SInt32                        controlPbAvail;            // number of read control parameter blocks available to sender
  140.     UInt32                        fcIndex;                // counts flow control messages
  141.     UInt32                        lastIndex;                // holds index of last received control message
  142.     UInt32                        controlIndex;            // counts sent control messages
  143.     Boolean                        fcStopSend;                // true if a write is in progress
  144.     Boolean                        writePending;            // true if a write is in progress
  145.     Boolean                        unitConnectionAdded;    // True if we've added our connection to our unit.
  146.     Boolean                        closed;                    // True if node connection has been closed.
  147.     Boolean                        writeAsynchCommandObjectInUse;    // True if writeAsynchCommandObject is in use.
  148.     Boolean                        fcSendCommandObjectInUse;    // True if fcSendCommandObject is in use.
  149.     Boolean                        fcReplyCommandObjectInUse;    // True if fcReplyCommandObject is in use.
  150. };
  151.  
  152.  
  153. #if PRAGMA_ALIGN_SUPPORTED
  154. #pragma options align=reset
  155. #endif
  156.  
  157. #if PRAGMA_IMPORT_SUPPORTED
  158. #pragma import off
  159. #endif
  160.  
  161. #ifdef __cplusplus
  162. }
  163. #endif
  164.  
  165. #endif /* __FWIXDRIVER__ */
  166.